package day5


object Test11 {
  def getMidoeElement[T](arr:Array[T]) = {arr(arr.length / 2)}

  def main(args: Array[String]): Unit = {
    // 取中间值
    val num: Array[Int] = Array(1, 2, 2,4,5,6,7)
    val result: Int = getMidoeElement(num)
    println(result)

    val num2: Array[String] = Array("aa", "bb", "cc", "dd", "ww")
    println(getMidoeElement(num2))
  }

}
